
/**
 * This is a generated class and is not intended for modification.  
 */
package valueObjects
{
import com.adobe.fiber.styles.IStyle;
import com.adobe.fiber.styles.Style;
import com.adobe.fiber.styles.StyleValidator;
import com.adobe.fiber.valueobjects.AbstractEntityMetadata;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import mx.events.ValidationResultEvent;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IModelType;
import mx.events.PropertyChangeEvent;

use namespace model_internal;

[ExcludeClass]
internal class _CustomDatatype6EntityMetadata extends com.adobe.fiber.valueobjects.AbstractEntityMetadata
{
    private static var emptyArray:Array = new Array();

    model_internal static var allProperties:Array = new Array("id", "tekst", "dlugoscgeo", "nazwa", "szerokoscgeo");
    model_internal static var allAssociationProperties:Array = new Array();
    model_internal static var allRequiredProperties:Array = new Array("id", "tekst", "dlugoscgeo", "nazwa", "szerokoscgeo");
    model_internal static var allAlwaysAvailableProperties:Array = new Array("id", "tekst", "dlugoscgeo", "nazwa", "szerokoscgeo");
    model_internal static var guardedProperties:Array = new Array();
    model_internal static var dataProperties:Array = new Array("id", "tekst", "dlugoscgeo", "nazwa", "szerokoscgeo");
    model_internal static var sourceProperties:Array = emptyArray
    model_internal static var nonDerivedProperties:Array = new Array("id", "tekst", "dlugoscgeo", "nazwa", "szerokoscgeo");
    model_internal static var derivedProperties:Array = new Array();
    model_internal static var collectionProperties:Array = new Array();
    model_internal static var collectionBaseMap:Object;
    model_internal static var entityName:String = "CustomDatatype6";
    model_internal static var dependentsOnMap:Object;
    model_internal static var dependedOnServices:Array = new Array();
    model_internal static var propertyTypeMap:Object;

    
    model_internal var _tekstIsValid:Boolean;
    model_internal var _tekstValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _tekstIsValidCacheInitialized:Boolean = false;
    model_internal var _tekstValidationFailureMessages:Array;
    
    model_internal var _dlugoscgeoIsValid:Boolean;
    model_internal var _dlugoscgeoValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _dlugoscgeoIsValidCacheInitialized:Boolean = false;
    model_internal var _dlugoscgeoValidationFailureMessages:Array;
    
    model_internal var _nazwaIsValid:Boolean;
    model_internal var _nazwaValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _nazwaIsValidCacheInitialized:Boolean = false;
    model_internal var _nazwaValidationFailureMessages:Array;
    
    model_internal var _szerokoscgeoIsValid:Boolean;
    model_internal var _szerokoscgeoValidator:com.adobe.fiber.styles.StyleValidator;
    model_internal var _szerokoscgeoIsValidCacheInitialized:Boolean = false;
    model_internal var _szerokoscgeoValidationFailureMessages:Array;

    model_internal var _instance:_Super_CustomDatatype6;
    model_internal static var _nullStyle:com.adobe.fiber.styles.Style = new com.adobe.fiber.styles.Style();

    public function _CustomDatatype6EntityMetadata(value : _Super_CustomDatatype6)
    {
        // initialize property maps
        if (model_internal::dependentsOnMap == null)
        {
            // dependents map
            model_internal::dependentsOnMap = new Object();
            model_internal::dependentsOnMap["id"] = new Array();
            model_internal::dependentsOnMap["tekst"] = new Array();
            model_internal::dependentsOnMap["dlugoscgeo"] = new Array();
            model_internal::dependentsOnMap["nazwa"] = new Array();
            model_internal::dependentsOnMap["szerokoscgeo"] = new Array();

            // collection base map
            model_internal::collectionBaseMap = new Object();
        }

        // Property type Map
        model_internal::propertyTypeMap = new Object();
        model_internal::propertyTypeMap["id"] = "int";
        model_internal::propertyTypeMap["tekst"] = "String";
        model_internal::propertyTypeMap["dlugoscgeo"] = "String";
        model_internal::propertyTypeMap["nazwa"] = "String";
        model_internal::propertyTypeMap["szerokoscgeo"] = "String";

        model_internal::_instance = value;
        model_internal::_tekstValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForTekst);
        model_internal::_tekstValidator.required = true;
        model_internal::_tekstValidator.requiredFieldError = "tekst is required";
        //model_internal::_tekstValidator.source = model_internal::_instance;
        //model_internal::_tekstValidator.property = "tekst";
        model_internal::_dlugoscgeoValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForDlugoscgeo);
        model_internal::_dlugoscgeoValidator.required = true;
        model_internal::_dlugoscgeoValidator.requiredFieldError = "dlugoscgeo is required";
        //model_internal::_dlugoscgeoValidator.source = model_internal::_instance;
        //model_internal::_dlugoscgeoValidator.property = "dlugoscgeo";
        model_internal::_nazwaValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForNazwa);
        model_internal::_nazwaValidator.required = true;
        model_internal::_nazwaValidator.requiredFieldError = "nazwa is required";
        //model_internal::_nazwaValidator.source = model_internal::_instance;
        //model_internal::_nazwaValidator.property = "nazwa";
        model_internal::_szerokoscgeoValidator = new StyleValidator(model_internal::_instance.model_internal::_doValidationForSzerokoscgeo);
        model_internal::_szerokoscgeoValidator.required = true;
        model_internal::_szerokoscgeoValidator.requiredFieldError = "szerokoscgeo is required";
        //model_internal::_szerokoscgeoValidator.source = model_internal::_instance;
        //model_internal::_szerokoscgeoValidator.property = "szerokoscgeo";
    }

    override public function getEntityName():String
    {
        return model_internal::entityName;
    }

    override public function getProperties():Array
    {
        return model_internal::allProperties;
    }

    override public function getAssociationProperties():Array
    {
        return model_internal::allAssociationProperties;
    }

    override public function getRequiredProperties():Array
    {
         return model_internal::allRequiredProperties;   
    }

    override public function getDataProperties():Array
    {
        return model_internal::dataProperties;
    }

    public function getSourceProperties():Array
    {
        return model_internal::sourceProperties;
    }

    public function getNonDerivedProperties():Array
    {
        return model_internal::nonDerivedProperties;
    }

    override public function getGuardedProperties():Array
    {
        return model_internal::guardedProperties;
    }

    override public function getUnguardedProperties():Array
    {
        return model_internal::allAlwaysAvailableProperties;
    }

    override public function getDependants(propertyName:String):Array
    {
       if (model_internal::nonDerivedProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a data property of entity CustomDatatype6");
            
       return model_internal::dependentsOnMap[propertyName] as Array;  
    }

    override public function getDependedOnServices():Array
    {
        return model_internal::dependedOnServices;
    }

    override public function getCollectionProperties():Array
    {
        return model_internal::collectionProperties;
    }

    override public function getCollectionBase(propertyName:String):String
    {
        if (model_internal::collectionProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a collection property of entity CustomDatatype6");

        return model_internal::collectionBaseMap[propertyName];
    }
    
    override public function getPropertyType(propertyName:String):String
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
            throw new Error(propertyName + " is not a property of CustomDatatype6");

        return model_internal::propertyTypeMap[propertyName];
    }

    override public function getAvailableProperties():com.adobe.fiber.valueobjects.IPropertyIterator
    {
        return new com.adobe.fiber.valueobjects.AvailablePropertyIterator(this);
    }

    override public function getValue(propertyName:String):*
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity CustomDatatype6");
        }

        return model_internal::_instance[propertyName];
    }

    override public function setValue(propertyName:String, value:*):void
    {
        if (model_internal::nonDerivedProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " is not a modifiable property of entity CustomDatatype6");
        }

        model_internal::_instance[propertyName] = value;
    }

    override public function getMappedByProperty(associationProperty:String):String
    {
        switch(associationProperty)
        {
            default:
            {
                return null;
            }
        }
    }

    override public function getPropertyLength(propertyName:String):int
    {
        switch(propertyName)
        {
            default:
            {
                return 0;
            }
        }
    }

    override public function isAvailable(propertyName:String):Boolean
    {
        if (model_internal::allProperties.indexOf(propertyName) == -1)
        {
            throw new Error(propertyName + " does not exist for entity CustomDatatype6");
        }

        if (model_internal::allAlwaysAvailableProperties.indexOf(propertyName) != -1)
        {
            return true;
        }

        switch(propertyName)
        {
            default:
            {
                return true;
            }
        }
    }

    override public function getIdentityMap():Object
    {
        var returnMap:Object = new Object();

        return returnMap;
    }

    [Bindable(event="propertyChange")]
    override public function get invalidConstraints():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_invalidConstraints;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_invalidConstraints;        
        }
    }

    [Bindable(event="propertyChange")]
    override public function get validationFailureMessages():Array
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_validationFailureMessages;
        }
    }

    override public function getDependantInvalidConstraints(propertyName:String):Array
    {
        var dependants:Array = getDependants(propertyName);
        if (dependants.length == 0)
        {
            return emptyArray;
        }

        var currentlyInvalid:Array = invalidConstraints;
        if (currentlyInvalid.length == 0)
        {
            return emptyArray;
        }

        var filterFunc:Function = function(element:*, index:int, arr:Array):Boolean
        {
            return dependants.indexOf(element) > -1;
        }

        return currentlyInvalid.filter(filterFunc);
    }

    /**
     * isValid
     */
    [Bindable(event="propertyChange")] 
    public function get isValid() : Boolean
    {
        if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
        {
            return model_internal::_instance.model_internal::_isValid;
        }
        else
        {
            // recalculate isValid
            model_internal::_instance.model_internal::_isValid = model_internal::_instance.model_internal::calculateIsValid();
            return model_internal::_instance.model_internal::_isValid;
        }
    }

    [Bindable(event="propertyChange")]
    public function get isIdAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isTekstAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isDlugoscgeoAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isNazwaAvailable():Boolean
    {
        return true;
    }

    [Bindable(event="propertyChange")]
    public function get isSzerokoscgeoAvailable():Boolean
    {
        return true;
    }


    /**
     * derived property recalculation
     */
    public function invalidateDependentOnTekst():void
    {
        if (model_internal::_tekstIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfTekst = null;
            model_internal::calculateTekstIsValid();
        }
    }
    public function invalidateDependentOnDlugoscgeo():void
    {
        if (model_internal::_dlugoscgeoIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfDlugoscgeo = null;
            model_internal::calculateDlugoscgeoIsValid();
        }
    }
    public function invalidateDependentOnNazwa():void
    {
        if (model_internal::_nazwaIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfNazwa = null;
            model_internal::calculateNazwaIsValid();
        }
    }
    public function invalidateDependentOnSzerokoscgeo():void
    {
        if (model_internal::_szerokoscgeoIsValidCacheInitialized )
        {
            model_internal::_instance.model_internal::_doValidationCacheOfSzerokoscgeo = null;
            model_internal::calculateSzerokoscgeoIsValid();
        }
    }

    model_internal function fireChangeEvent(propertyName:String, oldValue:Object, newValue:Object):void
    {
        this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, propertyName, oldValue, newValue));
    }

    [Bindable(event="propertyChange")]   
    public function get idStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    [Bindable(event="propertyChange")]   
    public function get tekstStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get tekstValidator() : StyleValidator
    {
        return model_internal::_tekstValidator;
    }

    model_internal function set _tekstIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_tekstIsValid;         
        if (oldValue !== value)
        {
            model_internal::_tekstIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "tekstIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get tekstIsValid():Boolean
    {
        if (!model_internal::_tekstIsValidCacheInitialized)
        {
            model_internal::calculateTekstIsValid();
        }

        return model_internal::_tekstIsValid;
    }

    model_internal function calculateTekstIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_tekstValidator.validate(model_internal::_instance.tekst)
        model_internal::_tekstIsValid_der = (valRes.results == null);
        model_internal::_tekstIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::tekstValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::tekstValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get tekstValidationFailureMessages():Array
    {
        if (model_internal::_tekstValidationFailureMessages == null)
            model_internal::calculateTekstIsValid();

        return _tekstValidationFailureMessages;
    }

    model_internal function set tekstValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_tekstValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_tekstValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "tekstValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get dlugoscgeoStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get dlugoscgeoValidator() : StyleValidator
    {
        return model_internal::_dlugoscgeoValidator;
    }

    model_internal function set _dlugoscgeoIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_dlugoscgeoIsValid;         
        if (oldValue !== value)
        {
            model_internal::_dlugoscgeoIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "dlugoscgeoIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get dlugoscgeoIsValid():Boolean
    {
        if (!model_internal::_dlugoscgeoIsValidCacheInitialized)
        {
            model_internal::calculateDlugoscgeoIsValid();
        }

        return model_internal::_dlugoscgeoIsValid;
    }

    model_internal function calculateDlugoscgeoIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_dlugoscgeoValidator.validate(model_internal::_instance.dlugoscgeo)
        model_internal::_dlugoscgeoIsValid_der = (valRes.results == null);
        model_internal::_dlugoscgeoIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::dlugoscgeoValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::dlugoscgeoValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get dlugoscgeoValidationFailureMessages():Array
    {
        if (model_internal::_dlugoscgeoValidationFailureMessages == null)
            model_internal::calculateDlugoscgeoIsValid();

        return _dlugoscgeoValidationFailureMessages;
    }

    model_internal function set dlugoscgeoValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_dlugoscgeoValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_dlugoscgeoValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "dlugoscgeoValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get nazwaStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get nazwaValidator() : StyleValidator
    {
        return model_internal::_nazwaValidator;
    }

    model_internal function set _nazwaIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_nazwaIsValid;         
        if (oldValue !== value)
        {
            model_internal::_nazwaIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "nazwaIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get nazwaIsValid():Boolean
    {
        if (!model_internal::_nazwaIsValidCacheInitialized)
        {
            model_internal::calculateNazwaIsValid();
        }

        return model_internal::_nazwaIsValid;
    }

    model_internal function calculateNazwaIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_nazwaValidator.validate(model_internal::_instance.nazwa)
        model_internal::_nazwaIsValid_der = (valRes.results == null);
        model_internal::_nazwaIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::nazwaValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::nazwaValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get nazwaValidationFailureMessages():Array
    {
        if (model_internal::_nazwaValidationFailureMessages == null)
            model_internal::calculateNazwaIsValid();

        return _nazwaValidationFailureMessages;
    }

    model_internal function set nazwaValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_nazwaValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_nazwaValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "nazwaValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }

    [Bindable(event="propertyChange")]   
    public function get szerokoscgeoStyle():com.adobe.fiber.styles.Style
    {
        return model_internal::_nullStyle;
    }

    public function get szerokoscgeoValidator() : StyleValidator
    {
        return model_internal::_szerokoscgeoValidator;
    }

    model_internal function set _szerokoscgeoIsValid_der(value:Boolean):void 
    {
        var oldValue:Boolean = model_internal::_szerokoscgeoIsValid;         
        if (oldValue !== value)
        {
            model_internal::_szerokoscgeoIsValid = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "szerokoscgeoIsValid", oldValue, value));
        }                             
    }

    [Bindable(event="propertyChange")]
    public function get szerokoscgeoIsValid():Boolean
    {
        if (!model_internal::_szerokoscgeoIsValidCacheInitialized)
        {
            model_internal::calculateSzerokoscgeoIsValid();
        }

        return model_internal::_szerokoscgeoIsValid;
    }

    model_internal function calculateSzerokoscgeoIsValid():void
    {
        var valRes:ValidationResultEvent = model_internal::_szerokoscgeoValidator.validate(model_internal::_instance.szerokoscgeo)
        model_internal::_szerokoscgeoIsValid_der = (valRes.results == null);
        model_internal::_szerokoscgeoIsValidCacheInitialized = true;
        if (valRes.results == null)
             model_internal::szerokoscgeoValidationFailureMessages_der = emptyArray;
        else
        {
            var _valFailures:Array = new Array();
            for (var a:int = 0 ; a<valRes.results.length ; a++)
            {
                _valFailures.push(valRes.results[a].errorMessage);
            }
            model_internal::szerokoscgeoValidationFailureMessages_der = _valFailures;
        }
    }

    [Bindable(event="propertyChange")]
    public function get szerokoscgeoValidationFailureMessages():Array
    {
        if (model_internal::_szerokoscgeoValidationFailureMessages == null)
            model_internal::calculateSzerokoscgeoIsValid();

        return _szerokoscgeoValidationFailureMessages;
    }

    model_internal function set szerokoscgeoValidationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_szerokoscgeoValidationFailureMessages;

        var needUpdate : Boolean = false;
        if (oldValue == null)
            needUpdate = true;
    
        // avoid firing the event when old and new value are different empty arrays
        if (!needUpdate && (oldValue !== value && (oldValue.length > 0 || value.length > 0)))
        {
            if (oldValue.length == value.length)
            {
                for (var a:int=0; a < oldValue.length; a++)
                {
                    if (oldValue[a] !== value[a])
                    {
                        needUpdate = true;
                        break;
                    }
                }
            }
            else
            {
                needUpdate = true;
            }
        }

        if (needUpdate)
        {
            model_internal::_szerokoscgeoValidationFailureMessages = value;   
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "szerokoscgeoValidationFailureMessages", oldValue, value));
            // Only execute calculateIsValid if it has been called before, to update the validationFailureMessages for
            // the entire entity.
            if (model_internal::_instance.model_internal::_cacheInitialized_isValid)
            {
                model_internal::_instance.model_internal::isValid_der = model_internal::_instance.model_internal::calculateIsValid();
            }
        }
    }


     /**
     * 
     * @inheritDoc 
     */ 
     override public function getStyle(propertyName:String):com.adobe.fiber.styles.IStyle
     {
         switch(propertyName)
         {
            default:
            {
                return null;
            }
         }
     }
     
     /**
     * 
     * @inheritDoc 
     *  
     */  
     override public function getPropertyValidationFailureMessages(propertyName:String):Array
     {
         switch(propertyName)
         {
            case("tekst"):
            {
                return tekstValidationFailureMessages;
            }
            case("dlugoscgeo"):
            {
                return dlugoscgeoValidationFailureMessages;
            }
            case("nazwa"):
            {
                return nazwaValidationFailureMessages;
            }
            case("szerokoscgeo"):
            {
                return szerokoscgeoValidationFailureMessages;
            }
            default:
            {
                return emptyArray;
            }
         }
     }

}

}
